Skip to content

feat(VEG-3619): Add connector bump command in zcli#325

Merged
zendesk-vishesh merged 1 commit intomasterfrom
zendesk-vishesh/connect-bump-cmd
Mar 23, 2026
Merged

feat(VEG-3619): Add connector bump command in zcli#325
zendesk-vishesh merged 1 commit intomasterfrom
zendesk-vishesh/connect-bump-cmd

Conversation

@zendesk-vishesh
Copy link
Contributor

@zendesk-vishesh zendesk-vishesh commented Mar 20, 2026

Description

This PR adds the connectors:bump command to ZCLI, enabling users to bump or update connector versions using semantic versioning. The command accepts major, minor, and patch flags, defaulting to patch, following the same pattern as the existing apps:bump command.

Changes:

  • Added packages/zcli-connectors/src/commands/connectors/bump.ts - New bump command that increments connector versions in src/index.ts using semver.
  • Modified packages/zcli-connectors/src/templates/starter/src/index.ts - Added version: '0.0.1' field to the starter template so all new connectors include version by default.
  • Modified packages/zcli-connectors/src/commands/connectors/create.ts - Updated to preserve the version field during connector creation.

Detail

Usage:

zcli connectors:bump # Bump patch (default): 1.0.0 → 1.0.1
zcli connectors:bump -m # Bump minor: 1.0.0 → 1.1.0
zcli connectors:bump -M # Bump major: 1.0.0 → 2.0.0
zcli connectors:bump -p # Bump patch (explicit): 1.0.0 → 1.0.1

Test Coverage:

  • Added comprehensive functional tests in packages/zcli-connectors/tests/functional/bump.test.ts

  • Successful Operations
    Default bump - Bumps patch version when no flag specified (1.0.0 → 1.0.1).
    Patch bump (-p) - Explicit patch increment (1.0.0 → 1.0.1).
    Minor bump (-m) - Minor version increment (1.0.0 → 1.1.0).
    Major bump (-M) - Major version increment (1.0.0 → 2.0.0).

  • Format Preservation
    Single quote preservation - Maintains version: '1.0.0' format through bumps.
    Double quote preservation - Maintains version: "1.0.0" format through bumps.
    Whitespace preservation - Preserves original spacing around version field.

  • Error Handling
    Missing directory error - Returns proper error when connector path is invalid.
    Missing index.ts error - Returns proper error when src/index.ts doesn't exist.
    Missing version field error - Returns proper error when version not found in manifest.
    Invalid semver error - Returns proper error when version format is invalid.

  • Platform Compatibility
    Cross-platform paths - Uses path.resolve() for OS-agnostic path handling (Windows/macOS/Linux).

Checklist

  • 💂‍♂️ includes new unit and functional tests

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants